#include <memory.h>
#include <cstdarg>
#include "Interator.h"
#include "getString.h"

//typedef struct T_Struct
//{
//	int a;
//	static int b;
//}MyStruct;
//
//int sum(int num_arg, ...)
//{
//	int result = 0;
//	int value = 0;
//
//	va_list marker;
//	va_start(marker, num_arg);
//	for(register int i =0; i< num_arg; i++)
//	{
//		value = va_arg(marker, int);
//		result += value;
//	}
//	va_end(marker);
//
//	return result;
//}
extern int TodoExtern(int a);
int main()
{
	printf("%d \n", TodoExtern(12));

	//printf("%d \n", sum(2, 1, 2));
	//printf("%d \n", sum(1,5));

	//printf("sizeof(int): %d \n", sizeof(int));

	//int n;

	//register int i;
	//int a[4] = {1};
	//n = 4;
	//Proccess1D(a, n);

	//int b[] = {1, 2, 3, 4};
	//printf("sizeof(int[]): %d \n", sizeof(b));
	//n = sizeof(b)/sizeof(int);
	//Proccess(b, n);

	//int c[4];
	//n = 4;
	//printf("before memset\n");
	//Proccess1D(c, n);
	///*memset(c, 0, 4*sizeof(int));
	//printf("sizeof(int[]): %d \n", sizeof(c));
	//Proccess1D(c, n);*/
	//memset(c, 15, sizeof(int));
	//printf("sizeof(int[]): %d \n", sizeof(c));
	//Proccess1D(c, n);

	//int n, m;
	////int d[3][2] = {{1, 2}, {3, 4}, {5, 6}};
	//int d[][2] = {1, 2, 3, 4, 5, 6};
	////int d[3][2] = {1, 2, 3, 4, 5, 6};
	//
	//m = 2;
	//n = sizeof(d)/(sizeof(int)*m);
	//for(register int i = 0; i< n; i++)
	//{
	//	for(register int j = 0; j<m; j++)
	//		printf("%d ", d[i][j]);
	//	printf("\n");
	//}

	/*int* p;
	int a = 10;
	p = &a;
	printf("position: %d \n", p);
	printf("value: %d \n", *p);
	printf("size: %d \n", sizeof(p));*/

	/*int a = 8587023;
	char* p1 = (char*) &a;
	printf("%c %d\n", *p1, *p1);
	short* p2 = (short*) &a;
	printf("%d", *p2);*/
	
	//int a = 16975631;
	//short* p1 = (short*) &a;
	//printf("p1: %d \n", *p1);
	//printf("p1 + 1: %d \n", p1 + 1);
	//printf("*(p1 + 1) %d\n", *(p1 + 1));

	////p1 += 1;
	//p1 = (short*)&a + 1;

	//printf("p1: %d \n", *p1);

	/*int a[] = {16975631, 2, 3, 4};
	printf("a %d\n", a);
	printf("&a %d\n", &a);
	printf("*a %d\n", *a);

	char* p = (char*)a;
	printf("p %d\n", *(p+1));
	printf("&p %d\n", &p);
	printf("*p %d\n", *p);*/
	/*int a[4] = {1, 2, 3, 4};
	printf("a: 0x%x\n", a);
	int *p = (int*)a;
	printf("value of p: 0x%x\n", p);
	printf("value of p memory: %d\n", *p);*/

	/*printf("String1 : %s \n", String1());

	char *st = String2();
	printf("String2 : %s \n", st);
	printf("0x%x \n", &st);

	printf("String3 : %s \n", String3());*/

	/*char* str1 = "String";
	char* str2 = new char[6];
	memcpy(str2, str1, 3*sizeof(char));
	printf("String1: %s\n", str1);
	printf("String2: %s\n", str2);*/

	
	//MyStruct mystruct;
	//printf("%d\n", sizeof(mystruct));

	////{
	//	mystruct.a = 10;
	//	MyStruct::b = 20;
	////}

	//int* p = &MyStruct::b;
	//printf("%d\n", *p);

	return 1;
}